<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>log</title>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <title>Document</title>
    <style>

        * {
            margin: 0px;
            padding: 0px;
        }


        #info {
            height: 600px;
            /* background-color: cornsilk; */
        }

        #all {

            margin-left: 20px;
            /* background-color: cornsilk; */
        }

        #change {
            width: 100px;
        }

        #titl {
            font-size: 20px;

        }

        .x1 {
            width: 300px;
        }

        .na {
            margin-left: 120px;
            width: 70px;
            height: 30px;
            float: left;
            border-right: 1px rgb(229, 229, 229) solid;
            margin-top: 5px;
        }

        .na1 {
            width: 120px;
            height: 50px;
            float: left;
            margin-left: 40px;
            color: rgb(102, 102, 102);
            font-size: 15px;
            box-sizing: border-box;
            padding-top: 5px;
            margin-top: 5px;
        }

        .na2 {
            margin-left: 700px;

        }

        .name {
            width: 800px;
            height: 101px;
            border-bottom: 1px rgb(229, 229, 229) solid;
            border-top: 1px rgb(229, 229, 229) solid;
            box-sizing: border-box;
            padding-top: 35px;
            font-size: 20px;
            margin-top: 40px;
            float: left;
        }

        .password {
            width: 800px;
            height: 101px;
            border-bottom: 1px rgb(229, 229, 229) solid;
            box-sizing: border-box;
            padding-top: 35px;
            font-size: 20px;
            float: left;
        }

        .birthday {
            width: 800px;
            height: 101px;
            border-bottom: 1px rgb(229, 229, 229) solid;
            box-sizing: border-box;
            padding-top: 35px;
            font-size: 20px;
            float: left;
        }

        .phone {
            width: 800px;
            height: 101px;
            border-bottom: 1px rgb(229, 229, 229) solid;
            box-sizing: border-box;
            padding-top: 35px;
            font-size: 20px;
            float: left;
        }

        .order-main {
            width: 885px;
            height: 100px;
            border-top: 1px gray solid;
        }

        .order-1 {
            float: left;
            margin-top: 5px;
            margin-left: 10px;
        }

        .order-2 {

            float: left;
            margin-top: 65px;
            font-size: 8px;
            color: gray;
            margin-left: 20px;
        }

        .order-3 {

            float: left;
            margin-top: 60px;
            margin-left: 15px;
        }

        .order-4 {
            margin-top: 55px;
            float: right;
            margin-right: 3px;
            width: 300px;
            height: 39px;
        }

        #x1{
            float: left;

        }
        #x2{
            float: left;
        }
        #x3{
            float: left;
            margin-top: 8px;
        }
        .p1 {
            font-size: 15px;
            margin-bottom: 10px;
        }
        .invite{
            height: 270px;
        }
        .in1{

            margin-left: 40px;
        }
        .in-1{
            height: 50px;
            width: 100px;
            box-sizing: border-box;
            float: left;
            padding-top: 10px;
            margin-left: 100px;
            position: absolute;
            top: 210px;
            left: 50px;
            color: white;

        }
        .in-2{
            height: 50px;
            width: 450px;
            position: absolute;
            float: left;
            margin-left: 10px;
            left: 250px;
            top: 210px;

        }
        .in-3{
            height: 50px;
            width: 50px;
            position: absolute;
            float: left;
            margin-left: 10px;
            left: 460px;
            top: 1px;

        }
        .ini{
            margin-bottom: 10px;
        }
        .ini img{
            height: 250px;
            width: 800px;

        }
        .x{
            width: 800px;
            height: 43px;
            color: white;
            background-color: rgb(243,194,70);
            margin-left: 40PX;
            box-sizing: border-box;
            padding-top: 8px;
            padding-left: 20px;
        }
        .xtable{
            width: 800px;
            margin-left: 40PX;
            height: 500px;
            box-shadow:wheat 0px 0px 10px
        }

        .el-table .warning-row {
            background: oldlace;
        }

        .el-table .success-row {
            background: #f0f9eb;
        }
    </style>
</head>
<body>
<div id="app">
    <el-container>

        <!-- 回到顶部 -->
        <template>
            <el-backtop></el-backtop>
        </template>

        <!-- 导航栏 -->
        <el-header style="height:145px;background-color: #F8F8F8;">
            <el-row>
                <el-col>
                    <el-menu default-active="1" class="el-menu-demo" mode="horizontal" @select="handleSelect"
                             background-color="#F8F8F8">
                        <el-menu-item index="1" style="margin-left: 350px;padding: 0px;">
                            <img src="../img/定位.png" width="35"/>
                        </el-menu-item>
                        <el-menu-item index="2" style="padding:0px;margin: 0px 5px;">
                            <a href="/html/shouye.html" style="text-decoration: none"><span>锅锅商城</span></a>
                        </el-menu-item>
                        <!--                    <el-menu-item index="3" style="padding: 0px;margin-right: 20px;">-->
                        <!--                        <span>[切换]</span>-->
                        <!--                    </el-menu-item>-->

                        <el-menu-item index="4" style="color: red;"><a
                                :href="myUrl" style="text-decoration: none;">{{username}}</a></el-menu-item>
                        <el-menu-item index="5" v-if="!loginStatus"><a :href="myUrl" style="text-decoration: none;">免费注册</a></el-menu-item>
                        <el-menu-item index="5" v-if="loginStatus" @click="logout">退出</el-menu-item>

                        <el-submenu index="6">
                            <template slot="title">个人中心</template>
                            <a :href="myUrl" style="text-decoration: none;">
                                <el-menu-item index="6-1">我的订单</el-menu-item>
                            </a>
                            <a :href="myUrl" style="text-decoration: none;">
                                <el-menu-item index="6-2">订单速查</el-menu-item>
                            </a>
                            <a :href="myUrl" style="text-decoration: none;">
                                <el-menu-item index="6-3">我的收藏</el-menu-item>
                            </a>
                            <a :href="myUrl" style="text-decoration: none;">
                                <el-menu-item index="6-4">我的评价</el-menu-item>
                            </a>
                            <a :href="myUrl" style="text-decoration: none;">
                                <el-menu-item index="6-5">我的设置</el-menu-item>
                            </a>
                            <a :href="myUrl" style="text-decoration: none;">
                                <el-menu-item index="6-6">会员中心</el-menu-item>
                            </a>
                            <a :href="myUrl" style="text-decoration: none;">
                                <el-menu-item index="6-7">积分商城</el-menu-item>
                            </a>
                        </el-submenu>

                        <el-submenu index="7">
                            <template slot="title">商户服务</template>
                            <el-menu-item index="7-1">商户中心</el-menu-item>
                            <el-menu-item index="7-2">申请加盟</el-menu-item>
                            <el-menu-item index="7-3">店铺编辑</el-menu-item>
                            <el-menu-item index="7-4">菜单编辑</el-menu-item>
                            <el-menu-item index="7-5">销量查询</el-menu-item>
                            <el-menu-item index="7-6">我的设置</el-menu-item>
                        </el-submenu>
                        <el-submenu index="8">
                            <template slot="title">帮助中心</template>
                            <el-menu-item index="8-1">平台规则</el-menu-item>
                            <el-menu-item index="8-2">联系客服</el-menu-item>
                        </el-submenu>
                    </el-menu>
                    <div class="line"></div>
                </el-col>
            </el-row>
            <!-- 搜索框 -->
            <el-row>
                <el-col style="margin-left: 350px;" :span="1">
                    <img src="../img/恐龙.png" width="50px"/>
                </el-col>
                <el-col :span="2">
                    <div style="font-size:16px;color:black;line-height: 50px;">锅锅餐饮</div>
                </el-col>
                <el-col :span="6" :offset="0">
                    <div style="margin-top: 1px;width:500px;line-height: 50px;">
                        <el-input placeholder="搜索商家或者地点" v-model="searchInput" class="input-with-select">
                            <el-select v-model="searchSelect" slot="prepend" placeholder="请选择"
                                       @change="MethodSearchSelectChange">
                                <el-option label="餐厅" value="1"></el-option>
                                <el-option label="地点" value="2"></el-option>
                                <el-option label="菜名" value="3"></el-option>
                                <el-option label="订单" value="4"></el-option>
                            </el-select>
                            <i slot="suffix" class="el-input__icon el-icon-circle-close"
                               @click="MethodClearSearchInput"></i>
                            <el-button slot="append" icon="el-icon-search" @click="MethodBeginSearch()"></el-button>
                        </el-input>
                    </div>
                </el-col>
            </el-row>
            <!-- 搜索框下的-"搜索发现" -->
            <el-row>
                <el-col style="margin-left:540px;" :span="1">
                    <span style="font-size: 12px;color:#999;">搜索发现：</span>
                </el-col>
                <el-col :span="0.1" v-for="i in searchReminderData" style="margin: 0px 5px;">
                    <span style="font-size: 12px;color:#999;" @click="MethodSearchReminderClick(i)">{{i}}</span>
                </el-col>
            </el-row>
        </el-header>


        <el-main id="main">
            <el-row :gutter="20">
                <el-col :span="15" :offset="4">
                    <div class="grid-content bg-purple">
                        <el-tabs type="border-card">
                            <el-tab-pane label="用户信息编辑" id="k1">
                                <el-container id="info">
                                    <el-form :inline="true" :model="queryForm">
                                        <div id="titl">
                                            个人信息：账户设置
                                        </div>
                                        <div id="all">

                                            <div class="name">
                                                <div class="na">
                                                    昵称
                                                </div>
                                                <div class="na1">{{queryForm.username}}</div>
                                                <div class="na2">
                                                    <el-button round @click="onSubmitname" id="changename">修改
                                                    </el-button>
                                                </div>
                                            </div>


                                            <div class="password">
                                                <div class="na">
                                                    密码
                                                </div>
                                                <div class="na1">*******</div>
                                                <div class="na2">
                                                    <el-button round @click="onSubmitpassword" id="changepassword">修改
                                                    </el-button>
                                                </div>
                                            </div>

                                            <div class="birthday">
                                                <div class="na">
                                                    生日
                                                </div>
                                                <div class="na1">{{queryForm.birthday}}</div>
                                                <div class="na2">
                                                    <el-button round @click="onSubmitbirthday" id="changebirthday">修改
                                                    </el-button>
                                                </div>
                                            </div>


                                            <div class="phone">
                                                <div class="na">
                                                    电话
                                                </div>
                                                <div class="na1">{{queryForm.phone}}</div>
                                                <div class="na2">
                                                    <el-button round @click="onSubmitphone" id="changephone">修改
                                                    </el-button>
                                                </div>
                                            </div>

                                            <div class="phone">
                                                <div class="na">
                                                    余额
                                                </div>
                                                <div class="na1">{{queryForm.balance}}</div>
                                                <div class="na2">

                                                </div>
                                            </div>

                                        </div>

                                    </el-form>
                                </el-container>
                            </el-tab-pane>
                            <el-tab-pane label="我的订单" id="k2">

                                <el-form :inline="true">
                                    <el-form-item label="订单查询">
                                        <el-input v-model="description" placeholder="请输入关键字"></el-input>
                                    </el-form-item>
                                    <el-form-item>
                                        <el-button type="primary" @click="search">搜索订单</el-button>
                                    </el-form-item>
                                </el-form>
                                <div id="order1" v-for="ord in tableData">
                                    <div class="order-main">
                                        <div class="order-1">
                                            <el-image style="width: 90px; height: 90px"
                                                      :src="ord.imgPath"
                                                      :fit="fit"></el-image>
                                        </div>

                                        <div class="order-3">
                                            {{ord.description}}
                                        </div>

                                        <div class="order-2">
                                            数量： {{ord.number}}

                                        </div>
                                        <div class="order-2">
                                            {{ord.state}}

                                        </div>
                                        <div class="order-4">
                                            总价￥{{ord.price}}
                                            <el-button round @click="handleClick(ord)">详情</el-button>
                                            <el-button round @click="handleClick1(ord)">退款</el-button>
                                        </div>

                                    </div>
                                </div>


                                <el-pagination @current-change='handle' :current-page="currPage"
                                               layout="prev, pager,jumper,total,next" :total="total"
                                               :page-size="pageSize">
                                </el-pagination>

                            </el-tab-pane>

                            <!-- 推广页 -->
                            <el-tab-pane label="我的推广" name="third">

                                <div class="invite">
                                    <div class="in1">
                                        <div class="ini"><img src="../img/invite1.png"></div>
                                        <div class="in-1">
                                            我的邀请链接:
                                        </div>
                                        <div class="in-2">
                                            <el-input  v-model="invition" id = "x1"></el-input>
                                            <div class="in-3"><el-button type="danger" class="btnn" >复制地址</el-button></div>

                                        </div>

                                    </div>


                                </div>
                                <div class="x">我的收益情况</div>



                                <div class="xtable">
                                    <template>
                                        <el-table
                                                :data="tableinvite"
                                                style="width: 100%"
                                                :row-class-name="tableRowClassName">
                                            <el-table-column    prop="invitedUserid" label="被邀请人id" width="180">
                                            </el-table-column>
                                            <el-table-column    prop="invitedName" label="昵称"  width="180">
                                            </el-table-column>
                                            <el-table-column    prop="number"  label="下单数量">
                                            </el-table-column>
                                            <el-table-column    prop="income"  label="累计收益">
                                            </el-table-column>
                                        </el-table>
                                    </template>
                                </div>
                            </el-tab-pane>



                        </el-tabs>
                    </div>
                </el-col>
            </el-row>
        </el-main>
        <el-container>
            <el-dialog title="订单详情" :visible.sync="personalInfoDialog" width="30%" center>
                <div class="p1">
                    订单id:{{order.orderId}}
                </div>
                <div class="p1">
                    订单描述:{{order.description}}
                </div>
                <div class="p1">消费码:{{order.checkCode}}
                </div>
                <div class="p1">
                    订单状态：{{order.state}}
                </div>
                <span slot="footer" class="dialog-footer">
                      <div>
                        <el-button type="primary" @click="personalInfoDialog=false">确定</el-button>
                      </div>

                    </span>
            </el-dialog>

            <!-- 退单模态框 -->
            <el-dialog title="退单" :visible.sync="personalInfoDialog1" width="30%" center>

                <div>

                    是否要进行退单，退单后不可消费

                </div>

                <span slot="footer" class="dialog-footer">
                   
                        <el-button type="primary" @click="refund(order.orderId)">确定</el-button>
                   

                    </span>

            </el-dialog>


            <el-dialog title="退单" :visible.sync="personalInfoDialog2" width="30%" center>

                <div>

                    该订单已经消费，无法退单

                </div>

                <span slot="footer" class="dialog-footer">
                   
                        <el-button type="primary"
                                   @click="personalInfoDialog2=false,personalInfoDialog3=false">确定</el-button>
                   

                    </span>

            </el-dialog>

            <el-dialog title="退单" :visible.sync="personalInfoDialog3" width="30%" center>

                <div>

                    该订单已经退款，无法再次操作

                </div>

                <span slot="footer" class="dialog-footer">
                   
                        <el-button type="primary"
                                   @click="personalInfoDialog2=false,personalInfoDialog3=false">确定</el-button>
                   

                    </span>

            </el-dialog>

            <!-- 修改姓名模态框 -->
            <el-dialog title="退单" :visible.sync="personalInfoDialogname" width="30%" center>

                <div>

                    修改昵称：
                    <el-input v-model="queryForm.username" class="x1"></el-input>

                </div>

                <span slot="footer" class="dialog-footer">
                   
                        <el-button type="primary" @click="onSubmit">提交</el-button>
                   

                    </span>

            </el-dialog>
            <!-- 修改密码模态框 -->
            <el-dialog title="修改密码" :visible.sync="personalInfoDialogpassword" width="30%" center>

                <div>

                    修改密码：
                    <el-input type='password' v-model="queryForm.password" class="x1"></el-input>

                </div>

                <span slot="footer" class="dialog-footer">
                   
                        <el-button type="primary" @click="onSubmit">提交</el-button>
                   

                    </span>

            </el-dialog>

            <!-- 修改生日模态框 -->
            <el-dialog title="退单" :visible.sync="personalInfoDialogbirthday" width="30%" center>

                <div>

                    修改生日：
                    <el-date-picker
                            v-model="queryForm.birthday"
                            type="date"
                            value-format="yyyy-MM-dd"
                            format="yyyy-MM-dd"
                            placeholder="选择日期">
                    </el-date-picker>

                </div>

                <span slot="footer" class="dialog-footer">
                   
                        <el-button type="primary" @click="onSubmit">提交</el-button>
                   

                    </span>

            </el-dialog>
            <!-- 修改电话模态框 -->
            <el-dialog title="退单" :visible.sync="personalInfoDialogphone" width="30%" center>

                <div>

                    电话：
                    <el-input v-model="queryForm.phone" class="x1"></el-input>

                </div>

                <span slot="footer" class="dialog-footer">
                   
                        <el-button type="primary" @click="onSubmit">提交</el-button>
                   

                    </span>

            </el-dialog>


        </el-container>


        <!-- 页脚 -->
        <el-container>
            <el-footer style="background: #F8F8F8; width: 100%;font-size: 12px;color: #999;height: 60px;">
                <el-row>
                    <el-col :span="20" :offset="2">
                        <img src="../img/页脚.png" height="100"/>
                    </el-col>
                </el-row>
            </el-footer>
        </el-container>

    </el-container>
</div>

<script src="../js/jquery-3.5.1.min.js"></script>
<script src="../js/vue.js"></script>
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
    var vm = new Vue({
        el: "#app",
        data: {
            queryForm: {
                userId: '',
                username: "",
                phone: '',
                password: '',
                birthday: ''
            },
            tableinvite: [],
            invition:"",
            fit: 'fill',
            url: '',
            reason: '',
            state: '',
            description: '',
            orderId: '',
            number: '',
            price: '',
            checkCode: '',
            order: {},
            personalInfoDialog: false,
            personalInfoDialog1: false,
            personalInfoDialog2: false,
            personalInfoDialog3: false,
            personalInfoDialogname: false,
            personalInfoDialogpassword: false,
            personalInfoDialogbirthday: false,
            personalInfoDialogphone: false,
            dialogVisible: false,
            total: 0,
            size: 0,
            currPage: 1,
            tableData: [],
            pageSize: 5,
            userId: 1,
            searchInput: "", //搜索输入框
            searchSelect: "",//搜索下拉框
            searchReminderData: ["金牌泰香米", "万州烤全鱼", "瓜西西火锅", "锅锅烤鸭", "五香串串"],
            myUrl: "/html/login.html",
            username: "你好，请登录",
            loginStatus: false

        },
        methods: {
            tableRowClassName({row, rowIndex}) {
                if (rowIndex === 1) {
                    return 'warning-row';
                } else if (rowIndex === 3) {
                    return 'success-row';
                }
                return '';
            },
            //查询邀请情况
            queryInvite:function(){
                let th = this;
                axios.get('/queryinvite', {
                    params: {
                    }
                })
                    .then(function (resp) {
                        if (resp.data.success) {
                            th.tableinvite = resp.data.data;
                            console.log(th.tableinvite)
                        } else {
                            th.$message.error('请求错误' + resp.data.message);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    })

            },
            handle: function (currPage, pageSize) {
                this.query(this.description, currPage, pageSize, this.userId);

            },
            search: function () {
                console.log(this.description);
                this.query(this.description, this.currPage, this.pageSize, this.userId);
            },
            query: function (description, currPage, pageSize, userId) {
                let th = this;
                axios.get('/queryOrder', {
                    params: {
                        description: description,
                        currPage: currPage,
                        pageSize: pageSize,
                        userId: th.userId
                    }
                })
                    .then(function (resp) {
                        // console.log(resp)
                        if (resp.data.success) {
                            let data = resp.data.data;
                            th.tableData = data.content;
                            th.total = data.totalCount;
                            th.currPage = data.currPage;
                            th.pageSize = data.pageSize;
                            for (let i = 0; i < th.tableData.length; i++) {

                                // console.log(th.tableData[i].state);

                                if (th.tableData[i].state == 0) {
                                    th.tableData[i].state = '未消费'
                                } else if (th.tableData[i].state == 1 || th.tableData[i].state == 3) {
                                    th.tableData[i].state = '已消费'
                                } else if (th.tableData[i].state == 2) {
                                    th.tableData[i].state = '已退款'
                                }
                            }
                        } else {
                            th.$message.error('请求错误' + resp.data.message);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    })
            },
            queryuser: function (userId) {
                console.log("userId：" + userId);
                let th = this;
                axios.get('/queryUser', {
                    params: {
                        userId: userId,
                        username: '',
                        phone: '',
                        password: '',
                        birthday: ''
                    }
                })
                    .then(function (resp1) {
                        // console.log(resp1);
                        if (resp1.data.success) {
                            th.queryForm = resp1.data.data;
                            th.invition='http://101.132.138.195/html/login.html?invitationCode='+th.queryForm.invitationCode
                        } else {
                            th.$message.error('请求错误' + resp.data.message);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    })
            },
            changeUser: function (username, phone, password, birthday, userId) {
                let th = this;
                axios.get('/changeUser', {
                    params: {
                        username: username,
                        password: password,
                        birthday: birthday,
                        phone: phone,
                        userId: userId
                    }
                })
                    .then(function (resp) {
                        if (resp.data.success) {
                            th.personalInfoDialogname = false;
                            th.personalInfoDialogpassword = false;
                            th.personalInfoDialogbirthday = false;
                            th.personalInfoDialogphone = false;
                        } else {
                            th.$message.error('请求错误' + resp.data.message);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    })

            },
            // 修改姓名
            onSubmitname: function () {
                this.personalInfoDialogname = true;
            },
            onSubmitpassword: function () {
                this.personalInfoDialogpassword = true;
            },
            onSubmitphone: function () {
                this.personalInfoDialogphone = true;
            },
            onSubmitbirthday: function () {
                this.personalInfoDialogbirthday = true;
            },

            handleSelect: function () {
            },
            onSubmit: function () {
                this.changeUser(this.queryForm.username, this.queryForm.phone, this.queryForm.password, this.queryForm.birthday, this.userId);
            },
            change1: function () {
                this.personalInfoDialog = false;
            },
            // 退单
            refund: function (reason) {
                //    console.log(this.order)
                let th = this;
                axios.get('/chargeback', {
                    params: {
                        orderId: th.order.orderId,
                        userId: th.order.userId,
                        shopId: th.order.shopId,
                        menuId: th.order.menuId,
                        price: th.order.price
                    }
                })
                    .then(function (resp) {
                        if (resp.data.success) {
                            th.query("", 1, 5, th.userId);
                            th.queryuser(th.userId);
                            th.personalInfoDialog1 = false;

                        } else {
                            th.$message.error('请求错误' + resp.data.message);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    })
            },
            handleClick: function (order) {
                this.order = order;
                this.personalInfoDialog = true;
            },
            // 申请退单
            handleClick1: function (order) {
                this.order = order;
                if (order.state == '未消费') {
                    this.personalInfoDialog1 = true;
                } else if (order.state == '已退款') {
                    this.personalInfoDialog3 = true;
                } else {
                    this.personalInfoDialog2 = true;
                }

            }, handleClose(done) {
                this.$confirm('确认关闭？')
                    .then(_ => {
                        done();
                    })
                    .catch(_ => {
                    });
            },
            handleSelect(key, keyPath) {    //顶部菜单激活信息回调
                console.log(key, keyPath);
            },
            MethodSearchSelectChange() { //输入下拉框改变触发事件

            },
            MethodSearchReminderClick(i) {   //搜索框下方字体点击
                this.searchInput = i;
            },
            MethodClearSearchInput() {   //叉叉按钮点击事件-清空搜索框里的文字
                this.searchInput = "";
            },
            MethodBeginSearch() {        //点击搜索图标按钮-开始搜索
                var message = this.searchInput;
                var type = this.searchSelect;
                var _this = this;
                if (message == "") {
                    _this.$message({
                        showClose: true,
                        message: "请输入内容再搜索",
                        type: 'warning',
                        duration: 1500
                    });
                } else {
                    //request search
                    var _this = this;
                    axios.get('/getSearchResult', {
                        params: {
                            message: message,
                            type: type,
                        }
                    })
                        .then(function (resp) {
                            console.log(resp);
                            if (resp.data.success) {
                                console.log(resp);
                                // if (resp.data.success) {
                                //     let data = resp.data.data;
                                //     _this.tableData = data.content;
                                //     _this.total = data.total;
                                //     _this.currPage = data.currPage;
                                //     location.href = "/html/search.html";
                                if (resp.data.success) {
                                    location.href = "/html/search.html";
                                } else {
                                    _this.$message.error('请求错误' + resp.data.message);
                                }

                            } else {
                                _this.$message.error('请求错误' + resp.data.message);
                            }
                        })
                        .catch(function (error) {
                            console.log(error);
                        })
                }
            },
            checkLoginStatus() {
                let that = this;
                $.ajax({
                    url: "/checkLoginStatus",
                    type: "get",
                    dataType: "json",
                    success: function (resp) {
                        if (resp.success) {
                            that.loginStatus = true;
                            that.myUrl = "/html/guoguolog.html";
                            that.username = resp.data.username;
                            that.userId = resp.data.userId;
                            that.query("", 1, 5, that.userId);
                            that.queryuser(that.userId);
                            that.query("", 1, 5, this.userId);
                        }
                    }
                });
            },
            logout() {
                $.ajax({
                    url: "/logout",
                    type: "get",
                    dataType: "json",
                    success: function (resp) {
                        if (resp.success) {
                            location.href = "/html/shouye.html";
                        }
                    }
                });
            }
        }
        ,
        mounted: function () {
            this.checkLoginStatus();
            this.queryInvite();
            //this.query("", 1, 5, this.userId);
            // console.log("mounted:" + this.userId);
            // this.queryuser(this.userId);
        }
    })
    // 复制
    let copyBtn = document.getElementsByClassName('btnn')[0];
    copyBtn.onclick = function(){
        let copyVal = document.getElementById("x1");
        copyVal.select();
        document.execCommand("Copy")
        try{
            if(document.execCommand('copy', false, null)){
                //success info
                console.log("doSomething...");
            } else{
                //fail info
                console.log("doSomething...");
            }
        } catch(err){
            //fail info
            console.log("doSomething...");
        }
    }
</script>
</body>
</html>